import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DBTest {


	
	public static void main(String[] args) {
		
		Connection conn = null;
		Statement statement = null;
		ResultSet rs = null;
		
		DBManager db = new DBManager();
		
		String sql = "select * from migrations";

		try {
			conn = db.getConnection();

			statement = conn.createStatement();

			rs =  statement.executeQuery(sql);
			
			System.out.println("执行结果如下所示:"); 
			while(rs.next()) {
				String id = rs.getString("id");
				String mig = rs.getString("migration");
				
				System.out.println("id:"+id+ " migration:"+mig );
			}
			

		}
		catch (SQLException  e) {
			//数据库连接失败异常处理
            e.printStackTrace(); 
		}
		
		finally {
			db.CloseAll(conn,statement,rs);
			
		}
		
		
		

		
	}
}
